package com.requiem.hist_group_manage_springboot.service.impl;

import com.requiem.hist_group_manage_springboot.exception.R;
import com.requiem.hist_group_manage_springboot.mapper.ManagerMapper;
import com.requiem.hist_group_manage_springboot.service.AccountService;
import jakarta.servlet.http.HttpServletRequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AccountServiceImpl implements AccountService {

    @Autowired
    private HttpServletRequest request;
    @Autowired
    ManagerMapper managerMapper;

    public R getUserInfo() {
        int id = Integer.parseInt(request.getAttribute("user_id").toString());
        return R.success(managerMapper.getManagerById(id));
    }
}
